import { reactive } from "vue";
export default function useDialog() {
  // 定义弹框属性
  const dialog = reactive({
    title: "新增",
    visible: false,
    width: 630,
    height: 280
  });

  // 弹框关闭事件
  const onClose = () => {
    dialog.visible = false;
  };
  // 弹框确认事件
  const onConfirm = () => {
    dialog.visible = false;
  };
  const onShow = () => {
    dialog.visible = true;
  };
  // 返回弹框属性
  return {
    dialog,
    onClose,
    onConfirm,
    onShow
  };
}
